home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / remote.doc < prev    next >
Text File  |  1995-03-31  |  4KB  |  86 lines

  1. (Comp.sys.hp48) 
  2. Item: 2 by _davemarsh at hpcvbbs.cv.hp.com 
  3. Author: [DAVID J. MARSH] 
  4.   Subj: IR remote repost 
  5.   Date: Mon Sep 30 1991  [repost; originally posted Aug 10, 1991] 
  6.  
  7. Presented here are three programs that form the basis of a learning 
  8. remote control application for the HP48. 
  9.   
  10. The brief decription: 
  11.   
  12.    NEWSTR- creates a string of N spaces. 
  13.    LOOK- Requires a string as input, samples IR, outputs changed string 
  14.    XMITREM- Requires output of LOOK, transmits IR. 
  15.   
  16. The verbose description: 
  17.   
  18.   LOOK uses the length of the input string as a loop counter, and 
  19. replaces the data area of the string with IR sample data.  Any string may 
  20. be used as input, but the length of the string is important.  The 
  21. sampling loop runs at just over 26kHz, so an input string of 1500 
  22. characters in length provides just over 100ms of sample time.  Most 
  23. remote controls have signals that fall nicely in this range, however, if 
  24. you can't get it to work, try a longer sample length.  (Notably, my 
  25. Scientific Atlanta cable box requires a string length of 2000 to work 
  26. reliably).  The distance between the remote and the '48 is also 
  27. important- if the remote is too far away, signal will be inadequate, but 
  28. if it is too close, the Phototransistor may get swamped.  I have found 
  29. that most remotes behave well when nearly touching the '48, but some 
  30. experimentation may be necessary in any given case. 
  31.   
  32.   NEWSTR may be used to easily create the input string for LOOK. 
  33.   
  34.   XMITREM takes a string from the stack and uses its data as a template 
  35. for the IR transmission.  The inner loop within the program has exactly 
  36. the same execution speed as the loop in LOOK, so that the output timing 
  37. may be as exact as possible.  Although this loop is only running at about 
  38. 26kHz, (as opposed to the optimal speed of 80kHz), it seems to work very 
  39. well in most applications.  Most devices may be controlled from a 
  40. distance of about 10 feet away, with some going up to as much as 15 feet 
  41. away (my VCR). 
  42.   
  43.   These programs are not intended to be a finished application, but 
  44. rather building blocks that may be used underneath any user interface 
  45. that you might want to use. 
  46.   
  47. One last thought-  There are several ways in which the functionality of 
  48. these programs can be upgraded.  The data storage is not very efficient, 
  49. because it is optimized for speed- some simple compression would help 
  50. tremendously. ( I am only using 1 bit in each nibble for data.) 
  51. If there is sufficient interest, I am not unwilling to post the source 
  52. files for these programs. I presented it at the HP Handheld conference in 
  53. Corvallis, and the proceedings from that conference are available from 
  54. Educalc. 
  55.   
  56. Dave Marsh 
  57.  
  58. ---------- 
  59.  
  60. The above is a repost of my original posting, for those who have been 
  61. asking... 
  62.  
  63. I am still in the process of improving these routines, based on the many 
  64. excellent suggestions from everyone out in Netland.  Currently, the new 
  65. version is nearly ready to post (incorporating some of Rick's (Grevelle) 
  66. excellent routines- compression/decompression, automatic string creation, 
  67. etc.), but time constraints are preventing me from finishing the project 
  68. for a few weeks.  In the meantime, please use these programs if they 
  69. interest you.   
  70.  
  71. [Note: See REMOTE2 on this disk...  -jkh-] 
  72.  
  73. P.S. Some excellent compression is possible using the Redundancy Fighter 
  74. program that was posted to this group not too long ago [and included on 
  75. this disk; see RF.  -jkh-]. 
  76.  
  77. P.P.S.  It has been pointed out to me (correctly so) that the NEWSTR 
  78. program above stinks...  personally, I was using Jim Donnelly's RPTSTR to 
  79. create my strings, but I didn't want to violate his copyright by posting 
  80. that routine with this.  Anyway, it will be fixed soon as I'm able. 
  81.  
  82. [Note: If you have the Tool Library, you may replace NEWSTR with 
  83.  << 32 SWAP STRCON >>, which will run MUCH faster.  -jkh-] 
  84.  
  85. Enjoy! 
  86.